package com.dxy.dxyadmin.controller;


import com.dxy.dxycommon.VO.ResultVO;
import com.dxy.dxyproduct.client.ProductClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * junfeng 2018/11/6 管理员控制器
 */
@Slf4j
@RestController
@RequestMapping("/admin")
public class ProductApiController {

    @Autowired
    ProductClient productClient;

    @RequestMapping("/product/list")
    public ResultVO list(@RequestParam("pageSize") Integer page,
                         @RequestParam("limit") Integer size,
                         @RequestParam("status") Integer status,
                         @RequestParam("name") String name) {
        ResultVO msg = productClient.listProduct(page, size,status, name);
        return msg;
    }


    @RequestMapping("/product/deleteProduct")
    public ResultVO list(@RequestParam("id") String id) {
        ResultVO msg = productClient.deleteProduct(id);
        return msg;
    }


}
